<template>
    <van-nav-bar title="搜索页" />
    <div>
        <van-search v-model="value" show-action label="地址" placeholder="请输入搜索关键词" @search="onSearch">
        </van-search>

        <div v-for="item in searchApiData">
            <router-link :to="'/xq/' + item.goods_id">
                <van-card :price="item.goods_price" :title="item.goods_name"
                    :thumb="item.goods_big_logo ? item.goods_big_logo : 'https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg'" />
            </router-link>
        </div>

    </div>
</template>

<script setup>
import { ref, } from 'vue'
import { searchApi } from '@/api/api'
const searchApiData = ref([])
searchApi().then(res => {
    console.log('搜索的数据', res);
    searchApiData.value = res.data.message.goods
})
</script>

<style lang="scss" scoped></style>